package edu.dayu.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

public class ImportListener<T> extends AnalysisEventListener<T> {

    ImportExcel<T> pool;

    public ImportListener(ImportExcel<T> pool){
        this.pool = pool;
    }

    @Override
    public void invoke(T t, AnalysisContext analysisContext) {
        pool.save(t);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        pool.from();
    }
}
